import request from '@/utils/request'

// 获取保养类型下拉列表
export function getMaintenanceTypeList() {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/maintenanceTypeList',
    method: 'get'
  })
}

// 获取保养状态下拉列表
export function getMaintenanceStatusList() {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/maintenanceOrderStatusList',
    method: 'get'
  })
}

// 获取设备下拉列表
export function getDeviceList() {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/deviceList',
    method: 'get'
  })
}

// 查询维修保养列表
export function getMaintenanceList(params) {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/list',
    method: 'get',
    params
  })
}

// 获取维修保养详细信息
export function getMaintenanceDetail(id) {
  return request({
    url: `/operation/web/operationEquipmentMaintenance/${id}`,
    method: 'get'
  })
}

// 新增维修保养
export function addMaintenance(data) {
  return request({
    url: '/operation/web/operationEquipmentMaintenance',
    method: 'post',
    data
  })
}

// 开始保养
export function startMaintenance(data) {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/startMaintenance',
    method: 'put',
    data
  })
}

// 完成保养
export function finishMaintenance(data) {
  return request({
    url: '/operation/web/operationEquipmentMaintenance/finishMaintenance',
    method: 'put',
    data
  })
}

// 删除维修保养
export function deleteMaintenance(ids) {
  return request({
    url: `/operation/web/operationEquipmentMaintenance/${ids}`,
    method: 'delete'
  })
}


// 获取负责人下拉列表-新
export function getUserListNew() {
  return request({
    url: '/operation/web/schedules/userList',
    method: 'get'
  })
}